<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.8.2.js"></script>
</head>
<body>
    <center>
        <div style="width: 1000px">
            <#list list as p>
                <dl style="float: left;margin: 20px">
                    <dt><img src="${p.purl}" height="100px" width="150px"/></dt>
                    <dd><a href="#" onclick="deletePic('${p.pid}')">删除</a></dd>
                </dl>
            </#list>
        </div>
        <div style="width: 1000px">
            <#if (list?size<=3)>
                <form action="saveGoodsPic.do" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="gid" value="${gid}"/>
                        <input type="file" name="file"/>
                    <input type="submit" value="上传"/>
                </form>
            </#if>
        </div>
    </center>
</body>
<script>
    function deletePic(pid) {
        $.post(
            "deletePicByPid.do",
                {pid:pid},
                function (data) {
                    alert(data);
                    location.reload(true);
                }
        );
    }
</script>
</html>
